    function Vue(parameters) {
        let vue = {};
        vue.routes = parameters.routes || [];
        vue.init = function() {
            document.querySelectorAll(".viewbox-menu-item").forEach((item, index) => {
                item.addEventListener("click", function(e) {
                    if (this.getAttribute("id") == 'menu6') {
                        if (window.location.href.indexOf('ics') > -1) {
                            window.open('http://www.njdtwise.com/FirePM/html/index/index.html')
                        } else if (window.location.href.indexOf('dev') > -1) {
                            window.open('http://dev.njdtwise.com/FirePM/html/index/index.html')
                        } else {
                            window.open('../../../FirePM/html/index/index.html')
                        }
                    }else {
                        $('.details-box').hide();
                        let event = e || window.event;
                        event.preventDefault();
                        if (window.location.hash.indexOf(this.getAttribute("href")) > -1) {
                            $('.site-top-item').removeClass("selected");
                            $('.street-count').removeClass("selected");
                            vue.routerChange();
                        }
                        window.location.hash = this.getAttribute("href");
                    }
                }, false);
            });

            window.addEventListener("hashchange", () => {
                vue.routerChange();
            });

            vue.routerChange();
        };
        vue.routerChange = () => {
            let nowHash = window.location.hash;
            let index = vue.routes.findIndex((item, index) => {
                return nowHash == ('#' + item.path);
            });
            if (index >= 0) {
                /* document.querySelector("#router-view").innerHTML = vue.routes[index].component;
                 */

                new vue.routes[index].function;
                let menuArr = $(".viewbox-menu-item");
                $.each(menuArr, function(index, el) {
                    $(el).find('img').attr("src", "../static/img/images/" + el.id + ".png");
                });

                $(".viewbox-menu-item").removeClass("selected");
                $('#' + vue.routes[index].id).addClass("selected");
                $(".viewbox-menu-item.selected").find('img').attr("src", "../static/img/images/" + vue.routes[index].id + "_sel.png");


            } else {
                let defaultIndex = vue.routes.findIndex((item, index) => {
                    return item.path == '*';
                });
                if (defaultIndex >= 0) {
                    window.location.hash = vue.routes[defaultIndex].redirect;
                }
            }
        };

        vue.init();
    }

    new Vue({
        routes: [{
            path: '/index',
            id: 'menu1',
            function: function() {
                $('.viewbox-left-index.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-index.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-index.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                overviewIndex(1);
                fireApplyBySevenDays();
                fireApplyRankingByThirtyDays();
                queryNumberForStreet();
                fireEyesCurrentStatus(1);
                fireEyesCurrentWarnStatus(1);
                initIndexMap();
            }
        }, {
            path: '/site',
            id: 'menu2',
            function: function() {
                $('.site-top-item').removeClass("selected");
                $('.left-site-list.viewbox-left-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.mid-site-street.viewbox-mid-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");

                $('.viewbox-left-site.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-site.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-site.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                queryNumberForStreet();
                $('.left-site-list-search>input').val('');
                queryAllSite('', true);
            }

        }, {
            path: '/approval',
            id: 'menu3',
            function: function() {
                $('.viewbox-left-approval.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-approval.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-approval.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                loadApprovalTable();
                approvalOverSize();
                $('.mid-approval-search-params input').val("");
            }
        }, {
            path: '/fireeye',
            id: 'menu4',
            function: function() {
                $('.viewbox-left-fireeye.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-fireeye.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-fireeye.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				// $('.viewbox-left-fireeye viewbox-left-box').addClass("hidden-view");
                loadFireeyeTable();
                fireeyeHistogram();
                fireEyesCurrentStatus(2);
                fireEyesCurrentWarnStatus(2);
                $('.mid-fireeye-table-tool input').val("");
            }

        }, {
            path: '/map',
            id: 'menu5',
            function: function() {
                $('.viewbox-left-map.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-map.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-map.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                initMap();
                overviewIndex(2);
                fireEyesCurrentWarnStatus(3);
            }

        }, {
            path: '/politics',
            id: 'menu7',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-politics.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                // initMap();
                // overviewIndex(2);
                // fireEyesCurrentWarnStatus(3);
				// var _iframe = document.getElementById('iframe').contentWindow.document.getElementsByClassName('head-mid');   //get iframe下的id
				//     _iframe[0].style.display= "none";  //修改样式
            }

        },
		// {
  //           path: '/multibandfire',
  //           id: 'menu8',
  //           function: function() {
  //               $('.viewbox-left-box').siblings().addClass("hidden-view");
  //               $('.viewbox-right-box').siblings().addClass("hidden-view");
  //               $('.viewbox-mid-multibandfire.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
		// 		loadMultibandfireTable();
  //               // initMap();
  //               // overviewIndex(2);
  //               // fireEyesCurrentWarnStatus(3);
		// 		// var _iframe = document.getElementById('iframe').contentWindow.document.getElementsByClassName('head-mid');   //get iframe下的id
		// 		//     _iframe[0].style.display= "none";  //修改样式
  //           }

  //       },
		{
            path: '/electricalSafety',
            id: 'menu8',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-electricalSafety.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadelectricalSafetyTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-electricalSafety-table-tool input').val("");
            }

        }, {
            path: '/yangan',
            id: 'menu9',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-yangan.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadyanganTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-yangan-table-tool input').val("");
            }

        },{
            path: '/shuixiang',
            id: 'menu10',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-shuixiang.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadshuixiangTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-shuixiang-table-tool input').val("");
            }

        },{
            path: '/bengshuiya',
            id: 'menu11',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-bengshuiya.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadbengshuiyaTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-bengshuiya-table-tool input').val("");
            }

        }, {
            path: '*',
            redirect: '/index'
        }]
    });